Skip to content

hive: wifi-p2p — Android WiFi Direct forager bee - #47

Open
adiled wants to merge 2 commits into
mainfrom
hives/wifi-p2p
Open

hive: wifi-p2p — Android WiFi Direct forager bee#47
adiled wants to merge 2 commits into
mainfrom
hives/wifi-p2p

Conversation

@adiled

@adiled adiled commented Aug 5, 2026

Copy link
Copy Markdown
Owner

wifi-p2p hive

A new hive that bridges Android WiFi Direct (WPA2-PSK P2P groups) into thrum, enabling infrastructure-free peer-to-peer agent mesh between phones.

Architecture

Phone A runs the bee as a foreground service:

  • P2pManager handles WiFi Direct discovery + group formation + TCP on p2p0
  • ThrumClient connects to local humd via Unix socket (Termux) or TCP bridge
  • Inbound P2P tones -> chi:"prompt" -> humd; chunk/finish replies flow back over P2P TCP

Files

file role
README.md full hive docs: propensity, wire diagram, config
Orchfile hum managed-service shape
app/.../WifiP2pBeeService.kt Android foreground service, main loop
app/.../P2pManager.kt WifiP2pManager: discovery, groups, TCP server
app/.../ThrumClient.kt NDJSON client to humd (Unix/TCP)
app/.../IdentityStore.kt Ed25519 seed persistence, byte-identical hid
app/.../Tone.kt chi registry, envelope, helpers

Propensity

statefulness richness wire
convention-stateful (per-peer sid) lean wifi-p2p/tcp

Why this fits

Fills the gap between gsm-modem (slow SMS, 160 bytes) and bp7 (store-and-forward DTN for spacecraft) -- high-bandwidth, low-latency, infrastructure-free local mesh between devices within walking distance. Sid stability per peer hid means conversations survive link drops. Same hello contract as every other forager.

Caveat

This is the first hive that must be an Android app -- WifiP2pManager is a system API, not accessible from CLI binaries. Everything else maps cleanly onto existing Hum abstractions.

adiled added 2 commits August 6, 2026 01:25
A new hive that bridges Android WiFi Direct (WPA2-PSK P2P groups) into
thrum, enabling infrastructure-free peer-to-peer agent mesh between
phones.

Architecture:
- Android foreground service (WifiP2pBeeService.kt)
- WifiP2pManager wrapper for discovery + group formation (P2pManager.kt)
- NDJSON thrum client to local humd (ThrumClient.kt)
- Ed25519 identity persistence, byte-identical to Rust/TS hives
  (IdentityStore.kt)
- Tone types + helpers matching thrum-core wire spec (Tone.kt)

Propensity: convention-stateful / lean / wifi-p2p/tcp
Wire: WiFi Direct P2P TCP on p2p0 interface, same NDJSON framing as thrum

Closes the gap between gsm-modem (slow SMS) and bp7 (store-and-forward
DTN) — high-bandwidth, low-latency local mesh for devices within
walking distance.
A narrative use case for the wifi-p2p hive: three strangers at a
picnic table whose phones form an ad-hoc agent mesh over WiFi Direct.
Prompts route through the best compute the mesh can find — local LLM,
cloud API, or peer's worker — without any setup or intentional
cooperation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant